package com.xq.shop.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.xq.shop.dao.ICategoryParamDAO;
import com.xq.shop.po.CategoryParam;
import com.xq.shop.util.HibernateUtil;

@Repository
public class CategoryParamDAO extends BaseDAO<CategoryParam> implements
		ICategoryParamDAO {

	@Override
	public void deleteByCategoryID(Long id) {
		
		Map<String, Object> param = new HashMap<String, Object>();
		String hql = "";
		if(id == null){
			hql = "delete CategoryParam where category_id is null";
		} else {
			hql = "delete CategoryParam where category_id in (:id)";
			param.put("id", id);
		}
		HibernateUtil.execute(hql, param);
	}
}
